package cn.tedu.simpleFactory;

public class TestFactory {
    /**
     *  简单工厂模式
     * @param args
     */
    public static void main(String[] args) {


        Fruit apple = null;
        Fruit orange = null;
        try {
            // 获取apple实例
            apple = FruitFactory.get("apple");
            // 获取orange实例
            orange = FruitFactory.get("orange");
        } catch (Exception e) {
            e.printStackTrace();
        }
        apple.get();
        orange.get();
    }
}
